< previous page page_13 next page >

Page 13
the pursuit of these concepts and ideas, you will discover the key abstractions that define the early boundaries of your system's types of classes. Notice the use of the term boundaries. As you iterate through the process of developing your solution, these boundaries evolve into one or more interfaces for your classes. Interfaces provide a public facade by which clients of the class request services without knowing the internal details of how these services are carried out. This lack of knowledge of internal operation details is called encapsulation.
New Term: Encapsulation describes the hiding of an object's private information and operations. Requests for information and services (via operations or methods) must occur by invoking public methods, including Visual Basic's property methods.
Classes define the behavior and identity of objects. Some classes can also define the behavior and identity of other classes. Such classes are called base classes. Base classes that cannot be instantiated into concrete objects are called abstract classes. Objects implementthat is, provide runtime code logic forthe behavior of concrete classes. Because Visual Basic is not as object-oriented as C++ (not C) or Smalltalk, your classes will generally be concrete or pure virtual. This means that classes that inherit the interface of another class must implement every one of its methods and properties.
Behavior
By now, you should have an understanding of how classes represent key abstractions from the context of the problem you're studying. As part of your research into a given problem, you will discover that the abstractions tend to exhibit some form of behavior. These behaviors are not clearly defined early in the process of developing a solution, but their conceptual representations start to take shape. These conceptual behaviors evolve into methods from the verbs your users choose in describing a problem.
New Term: Behavior is the anticipated response of an object when it receives stimuli in the form of a request from a client. A request for certain behavior usually results in the change of the object's state (attribute values).
A conceptual behavior eventually provides the foundation for actual class methods. An object's action or reaction is a manifestation of that object's behavior. Behavior exhibited by an object at any given time can lead to changes in the object's state. For example, given the class Woman, an instance of Woman would be someone named Jan Doe. One of her operations would be made manifest in the method getMarried. If she married an instance of Man named John Smith, the behavioral definition of the method getMarried might include a call to some method setLastName to change the last name from Doe to Smith (or Doe-Smith). You probably get the picture.

 
< previous page page_13 next page >

If you like this book, buy it!